﻿
using Jst.Domain.Attributes;

namespace Jst.Repository.SqlSugar.Internal
{
    internal static class Guard
    {
        internal static void EnsureAggregateRoot<T>()
        {
            var type = typeof(T);
            if (!Attribute.IsDefined(type, typeof(AggregateRootAttribute)))
            {
                throw new InvalidOperationException(
                    $"实体 {type.FullName} 必须标记 [AggregateRoot] 特性。");
            }
        }
    }
}